User.prototype.main_action = function() {
   res.data.title = this.username;
   
   // Check if the current User
   if (session.user == this) {
      res.data.body = this.renderSkinAsString("postForm");
      res.data.body += this.renderSkinAsString("main");
   } else {
      res.data.body = this.renderSkinAsString("main");
   }
   
   renderSkin("main");
}

User.prototype.addTask_action = function() {
   if (req.isPost() && req.data.newtask) {
      var task = new TaskUpdate(new Date(), req.data.newtask, this);
      this.tasks.add(task);
      res.redirect(this.href());
   }
   
   res.message = "Invalid request!";
   res.redirect(this.href());
}

User.prototype.updateStatus_action = function() {
   if (req.isPost() && req.data.statusmsg) {
      var update = new StatusUpdate(new Date(), req.data.statusmsg, this);
      this.updates.add(update);
      res.redirect(this.href());
   }
   
   res.message = "Invalid request!";
   res.redirect(this.href());
}
